/***************************************************************************
 *   Copyright (C) 2007 - 2009 by Andreas Theofilu                         *
 *   andreas@theosys.at                                                    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation version 3 of the License.                *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

/*
 * Ported to KDE4 on Jul. 8 2009 by Andreas Theofilu.
 */
#ifndef PROGRESSWIDGET_H
#define PROGRESSWIDGET_H

#include <QDialog>
#include "ui_progresswidgetbase.h"
#include "garmin.h"

class progressWidget : public QDialog, private Ui::Progress //WidgetBase
{
		Q_OBJECT

	public:
		progressWidget ( QWidget* parent = 0, Qt::WFlags fl = 0 );
		~progressWidget();
		/*$PUBLIC_FUNCTIONS$*/
		bool Download();
		static void CallBack(char *str);

	public slots:
		/*$PUBLIC_SLOTS$*/

	protected:
		/*$PROTECTED_FUNCTIONS$*/
		void IncrementBar();

	protected slots:
		/*$PROTECTED_SLOTS$*/

	private:
		int get_run_track_lap_info(garmin_data *run, uint32 *track_index, uint32 *first_lap_index, uint32 *last_lap_index);
		int get_lap_index(garmin_data *lap, uint32 *lap_index);
		int get_lap_start_time (garmin_data *lap, time_type *start_time);
		garmin_data *get_track(garmin_list *points, uint32 trk_index);

	private:
		int step, psteps;
};

#endif

